use std::collections::HashMap;

use redius::resp::{FrameBuffer, Value};
use serde::Deserialize;

/// cargo test --package redius --test deserializer -- test1 --exact --show-output --nocapture

const BYTES: [u8; 250] = [
    37, 55, 13, 10, 36, 54, 13, 10, 115, 101, 114, 118, 101, 114, 13, 10, 36, 53, 13, 10, 114, 101,
    100, 105, 115, 13, 10, 36, 55, 13, 10, 118, 101, 114, 115, 105, 111, 110, 13, 10, 36, 53, 13,
    10, 55, 46, 50, 46, 51, 13, 10, 36, 53, 13, 10, 112, 114, 111, 116, 111, 13, 10, 58, 51, 13,
    10, 36, 50, 13, 10, 105, 100, 13, 10, 58, 57, 13, 10, 36, 52, 13, 10, 109, 111, 100, 101, 13,
    10, 36, 49, 48, 13, 10, 115, 116, 97, 110, 100, 97, 108, 111, 110, 101, 13, 10, 36, 52, 13, 10,
    114, 111, 108, 101, 13, 10, 36, 54, 13, 10, 109, 97, 115, 116, 101, 114, 13, 10, 36, 55, 13,
    10, 109, 111, 100, 117, 108, 101, 115, 13, 10, 42, 49, 13, 10, 37, 52, 13, 10, 36, 52, 13, 10,
    110, 97, 109, 101, 13, 10, 36, 54, 13, 10, 82, 101, 74, 83, 79, 78, 13, 10, 36, 51, 13, 10,
    118, 101, 114, 13, 10, 58, 50, 48, 54, 48, 57, 13, 10, 36, 52, 13, 10, 112, 97, 116, 104, 13,
    10, 36, 51, 50, 13, 10, 47, 104, 111, 109, 101, 47, 114, 101, 100, 105, 115, 47, 109, 111, 100,
    117, 108, 101, 115, 47, 108, 105, 98, 114, 101, 106, 115, 111, 110, 46, 115, 111, 13, 10, 36,
    52, 13, 10, 97, 114, 103, 115, 13, 10, 42, 48, 13, 10,
];

const BYTES_2: [u8; 5608] = [
    61, 53, 53, 57, 57, 13, 10, 116, 120, 116, 58, 35, 32, 83, 101, 114, 118, 101, 114, 13, 10,
    114, 101, 100, 105, 115, 95, 118, 101, 114, 115, 105, 111, 110, 58, 55, 46, 50, 46, 51, 13, 10,
    114, 101, 100, 105, 115, 95, 103, 105, 116, 95, 115, 104, 97, 49, 58, 48, 48, 48, 48, 48, 48,
    48, 48, 13, 10, 114, 101, 100, 105, 115, 95, 103, 105, 116, 95, 100, 105, 114, 116, 121, 58,
    48, 13, 10, 114, 101, 100, 105, 115, 95, 98, 117, 105, 108, 100, 95, 105, 100, 58, 53, 51, 54,
    53, 54, 57, 100, 50, 54, 49, 100, 100, 51, 102, 97, 99, 13, 10, 114, 101, 100, 105, 115, 95,
    109, 111, 100, 101, 58, 115, 116, 97, 110, 100, 97, 108, 111, 110, 101, 13, 10, 111, 115, 58,
    76, 105, 110, 117, 120, 32, 52, 46, 49, 56, 46, 48, 45, 51, 52, 56, 46, 55, 46, 49, 46, 101,
    108, 56, 95, 53, 46, 120, 56, 54, 95, 54, 52, 32, 120, 56, 54, 95, 54, 52, 13, 10, 97, 114, 99,
    104, 95, 98, 105, 116, 115, 58, 54, 52, 13, 10, 109, 111, 110, 111, 116, 111, 110, 105, 99, 95,
    99, 108, 111, 99, 107, 58, 80, 79, 83, 73, 88, 32, 99, 108, 111, 99, 107, 95, 103, 101, 116,
    116, 105, 109, 101, 13, 10, 109, 117, 108, 116, 105, 112, 108, 101, 120, 105, 110, 103, 95, 97,
    112, 105, 58, 101, 112, 111, 108, 108, 13, 10, 97, 116, 111, 109, 105, 99, 118, 97, 114, 95,
    97, 112, 105, 58, 99, 49, 49, 45, 98, 117, 105, 108, 116, 105, 110, 13, 10, 103, 99, 99, 95,
    118, 101, 114, 115, 105, 111, 110, 58, 49, 49, 46, 50, 46, 49, 13, 10, 112, 114, 111, 99, 101,
    115, 115, 95, 105, 100, 58, 49, 53, 56, 52, 13, 10, 112, 114, 111, 99, 101, 115, 115, 95, 115,
    117, 112, 101, 114, 118, 105, 115, 101, 100, 58, 115, 121, 115, 116, 101, 109, 100, 13, 10,
    114, 117, 110, 95, 105, 100, 58, 51, 98, 49, 50, 54, 100, 53, 57, 50, 50, 52, 48, 50, 97, 98,
    55, 49, 100, 101, 56, 97, 49, 102, 100, 51, 101, 101, 98, 100, 57, 52, 55, 49, 57, 51, 51, 49,
    101, 53, 49, 13, 10, 116, 99, 112, 95, 112, 111, 114, 116, 58, 54, 51, 55, 57, 13, 10, 115,
    101, 114, 118, 101, 114, 95, 116, 105, 109, 101, 95, 117, 115, 101, 99, 58, 49, 55, 50, 53, 50,
    52, 48, 49, 49, 50, 56, 54, 56, 49, 50, 56, 13, 10, 117, 112, 116, 105, 109, 101, 95, 105, 110,
    95, 115, 101, 99, 111, 110, 100, 115, 58, 55, 50, 51, 13, 10, 117, 112, 116, 105, 109, 101, 95,
    105, 110, 95, 100, 97, 121, 115, 58, 48, 13, 10, 104, 122, 58, 49, 48, 13, 10, 99, 111, 110,
    102, 105, 103, 117, 114, 101, 100, 95, 104, 122, 58, 49, 48, 13, 10, 108, 114, 117, 95, 99,
    108, 111, 99, 107, 58, 49, 51, 57, 54, 52, 48, 56, 48, 13, 10, 101, 120, 101, 99, 117, 116, 97,
    98, 108, 101, 58, 47, 104, 111, 109, 101, 47, 114, 101, 100, 105, 115, 47, 114, 101, 100, 105,
    115, 45, 115, 101, 114, 118, 101, 114, 13, 10, 99, 111, 110, 102, 105, 103, 95, 102, 105, 108,
    101, 58, 47, 104, 111, 109, 101, 47, 114, 101, 100, 105, 115, 47, 99, 111, 110, 102, 115, 47,
    114, 101, 100, 105, 115, 45, 54, 51, 55, 57, 46, 99, 111, 110, 102, 13, 10, 105, 111, 95, 116,
    104, 114, 101, 97, 100, 115, 95, 97, 99, 116, 105, 118, 101, 58, 48, 13, 10, 108, 105, 115,
    116, 101, 110, 101, 114, 48, 58, 110, 97, 109, 101, 61, 116, 99, 112, 44, 98, 105, 110, 100,
    61, 49, 50, 55, 46, 48, 46, 48, 46, 49, 44, 98, 105, 110, 100, 61, 49, 57, 50, 46, 49, 54, 56,
    46, 49, 50, 56, 46, 49, 51, 49, 44, 112, 111, 114, 116, 61, 54, 51, 55, 57, 13, 10, 13, 10, 35,
    32, 67, 108, 105, 101, 110, 116, 115, 13, 10, 99, 111, 110, 110, 101, 99, 116, 101, 100, 95,
    99, 108, 105, 101, 110, 116, 115, 58, 49, 13, 10, 99, 108, 117, 115, 116, 101, 114, 95, 99,
    111, 110, 110, 101, 99, 116, 105, 111, 110, 115, 58, 48, 13, 10, 109, 97, 120, 99, 108, 105,
    101, 110, 116, 115, 58, 49, 48, 48, 48, 48, 13, 10, 99, 108, 105, 101, 110, 116, 95, 114, 101,
    99, 101, 110, 116, 95, 109, 97, 120, 95, 105, 110, 112, 117, 116, 95, 98, 117, 102, 102, 101,
    114, 58, 48, 13, 10, 99, 108, 105, 101, 110, 116, 95, 114, 101, 99, 101, 110, 116, 95, 109, 97,
    120, 95, 111, 117, 116, 112, 117, 116, 95, 98, 117, 102, 102, 101, 114, 58, 48, 13, 10, 98,
    108, 111, 99, 107, 101, 100, 95, 99, 108, 105, 101, 110, 116, 115, 58, 48, 13, 10, 116, 114,
    97, 99, 107, 105, 110, 103, 95, 99, 108, 105, 101, 110, 116, 115, 58, 48, 13, 10, 99, 108, 105,
    101, 110, 116, 115, 95, 105, 110, 95, 116, 105, 109, 101, 111, 117, 116, 95, 116, 97, 98, 108,
    101, 58, 48, 13, 10, 116, 111, 116, 97, 108, 95, 98, 108, 111, 99, 107, 105, 110, 103, 95, 107,
    101, 121, 115, 58, 48, 13, 10, 116, 111, 116, 97, 108, 95, 98, 108, 111, 99, 107, 105, 110,
    103, 95, 107, 101, 121, 115, 95, 111, 110, 95, 110, 111, 107, 101, 121, 58, 48, 13, 10, 13, 10,
    35, 32, 77, 101, 109, 111, 114, 121, 13, 10, 117, 115, 101, 100, 95, 109, 101, 109, 111, 114,
    121, 58, 50, 49, 56, 49, 48, 48, 56, 13, 10, 117, 115, 101, 100, 95, 109, 101, 109, 111, 114,
    121, 95, 104, 117, 109, 97, 110, 58, 50, 46, 48, 56, 77, 13, 10, 117, 115, 101, 100, 95, 109,
    101, 109, 111, 114, 121, 95, 114, 115, 115, 58, 49, 53, 51, 55, 50, 50, 56, 56, 13, 10, 117,
    115, 101, 100, 95, 109, 101, 109, 111, 114, 121, 95, 114, 115, 115, 95, 104, 117, 109, 97, 110,
    58, 49, 52, 46, 54, 54, 77, 13, 10, 117, 115, 101, 100, 95, 109, 101, 109, 111, 114, 121, 95,
    112, 101, 97, 107, 58, 50, 52, 48, 57, 52, 56, 48, 13, 10, 117, 115, 101, 100, 95, 109, 101,
    109, 111, 114, 121, 95, 112, 101, 97, 107, 95, 104, 117, 109, 97, 110, 58, 50, 46, 51, 48, 77,
    13, 10, 117, 115, 101, 100, 95, 109, 101, 109, 111, 114, 121, 95, 112, 101, 97, 107, 95, 112,
    101, 114, 99, 58, 57, 48, 46, 53, 50, 37, 13, 10, 117, 115, 101, 100, 95, 109, 101, 109, 111,
    114, 121, 95, 111, 118, 101, 114, 104, 101, 97, 100, 58, 57, 51, 54, 50, 52, 56, 13, 10, 117,
    115, 101, 100, 95, 109, 101, 109, 111, 114, 121, 95, 115, 116, 97, 114, 116, 117, 112, 58, 57,
    51, 53, 48, 56, 56, 13, 10, 117, 115, 101, 100, 95, 109, 101, 109, 111, 114, 121, 95, 100, 97,
    116, 97, 115, 101, 116, 58, 49, 50, 52, 52, 55, 54, 48, 13, 10, 117, 115, 101, 100, 95, 109,
    101, 109, 111, 114, 121, 95, 100, 97, 116, 97, 115, 101, 116, 95, 112, 101, 114, 99, 58, 57,
    57, 46, 57, 49, 37, 13, 10, 97, 108, 108, 111, 99, 97, 116, 111, 114, 95, 97, 108, 108, 111,
    99, 97, 116, 101, 100, 58, 50, 53, 48, 50, 52, 50, 52, 13, 10, 97, 108, 108, 111, 99, 97, 116,
    111, 114, 95, 97, 99, 116, 105, 118, 101, 58, 50, 55, 56, 57, 51, 55, 54, 13, 10, 97, 108, 108,
    111, 99, 97, 116, 111, 114, 95, 114, 101, 115, 105, 100, 101, 110, 116, 58, 53, 55, 55, 53, 51,
    54, 48, 13, 10, 116, 111, 116, 97, 108, 95, 115, 121, 115, 116, 101, 109, 95, 109, 101, 109,
    111, 114, 121, 58, 51, 56, 57, 48, 48, 50, 56, 53, 52, 52, 13, 10, 116, 111, 116, 97, 108, 95,
    115, 121, 115, 116, 101, 109, 95, 109, 101, 109, 111, 114, 121, 95, 104, 117, 109, 97, 110, 58,
    51, 46, 54, 50, 71, 13, 10, 117, 115, 101, 100, 95, 109, 101, 109, 111, 114, 121, 95, 108, 117,
    97, 58, 51, 49, 55, 52, 52, 13, 10, 117, 115, 101, 100, 95, 109, 101, 109, 111, 114, 121, 95,
    118, 109, 95, 101, 118, 97, 108, 58, 51, 49, 55, 52, 52, 13, 10, 117, 115, 101, 100, 95, 109,
    101, 109, 111, 114, 121, 95, 108, 117, 97, 95, 104, 117, 109, 97, 110, 58, 51, 49, 46, 48, 48,
    75, 13, 10, 117, 115, 101, 100, 95, 109, 101, 109, 111, 114, 121, 95, 115, 99, 114, 105, 112,
    116, 115, 95, 101, 118, 97, 108, 58, 48, 13, 10, 110, 117, 109, 98, 101, 114, 95, 111, 102, 95,
    99, 97, 99, 104, 101, 100, 95, 115, 99, 114, 105, 112, 116, 115, 58, 48, 13, 10, 110, 117, 109,
    98, 101, 114, 95, 111, 102, 95, 102, 117, 110, 99, 116, 105, 111, 110, 115, 58, 48, 13, 10,
    110, 117, 109, 98, 101, 114, 95, 111, 102, 95, 108, 105, 98, 114, 97, 114, 105, 101, 115, 58,
    48, 13, 10, 117, 115, 101, 100, 95, 109, 101, 109, 111, 114, 121, 95, 118, 109, 95, 102, 117,
    110, 99, 116, 105, 111, 110, 115, 58, 51, 50, 55, 54, 56, 13, 10, 117, 115, 101, 100, 95, 109,
    101, 109, 111, 114, 121, 95, 118, 109, 95, 116, 111, 116, 97, 108, 58, 54, 52, 53, 49, 50, 13,
    10, 117, 115, 101, 100, 95, 109, 101, 109, 111, 114, 121, 95, 118, 109, 95, 116, 111, 116, 97,
    108, 95, 104, 117, 109, 97, 110, 58, 54, 51, 46, 48, 48, 75, 13, 10, 117, 115, 101, 100, 95,
    109, 101, 109, 111, 114, 121, 95, 102, 117, 110, 99, 116, 105, 111, 110, 115, 58, 49, 56, 52,
    13, 10, 117, 115, 101, 100, 95, 109, 101, 109, 111, 114, 121, 95, 115, 99, 114, 105, 112, 116,
    115, 58, 49, 56, 52, 13, 10, 117, 115, 101, 100, 95, 109, 101, 109, 111, 114, 121, 95, 115, 99,
    114, 105, 112, 116, 115, 95, 104, 117, 109, 97, 110, 58, 49, 56, 52, 66, 13, 10, 109, 97, 120,
    109, 101, 109, 111, 114, 121, 58, 48, 13, 10, 109, 97, 120, 109, 101, 109, 111, 114, 121, 95,
    104, 117, 109, 97, 110, 58, 48, 66, 13, 10, 109, 97, 120, 109, 101, 109, 111, 114, 121, 95,
    112, 111, 108, 105, 99, 121, 58, 110, 111, 101, 118, 105, 99, 116, 105, 111, 110, 13, 10, 97,
    108, 108, 111, 99, 97, 116, 111, 114, 95, 102, 114, 97, 103, 95, 114, 97, 116, 105, 111, 58,
    49, 46, 49, 49, 13, 10, 97, 108, 108, 111, 99, 97, 116, 111, 114, 95, 102, 114, 97, 103, 95,
    98, 121, 116, 101, 115, 58, 50, 56, 54, 57, 53, 50, 13, 10, 97, 108, 108, 111, 99, 97, 116,
    111, 114, 95, 114, 115, 115, 95, 114, 97, 116, 105, 111, 58, 50, 46, 48, 55, 13, 10, 97, 108,
    108, 111, 99, 97, 116, 111, 114, 95, 114, 115, 115, 95, 98, 121, 116, 101, 115, 58, 50, 57, 56,
    53, 57, 56, 52, 13, 10, 114, 115, 115, 95, 111, 118, 101, 114, 104, 101, 97, 100, 95, 114, 97,
    116, 105, 111, 58, 50, 46, 54, 54, 13, 10, 114, 115, 115, 95, 111, 118, 101, 114, 104, 101, 97,
    100, 95, 98, 121, 116, 101, 115, 58, 57, 53, 57, 54, 57, 50, 56, 13, 10, 109, 101, 109, 95,
    102, 114, 97, 103, 109, 101, 110, 116, 97, 116, 105, 111, 110, 95, 114, 97, 116, 105, 111, 58,
    55, 46, 49, 56, 13, 10, 109, 101, 109, 95, 102, 114, 97, 103, 109, 101, 110, 116, 97, 116, 105,
    111, 110, 95, 98, 121, 116, 101, 115, 58, 49, 51, 50, 51, 49, 51, 50, 56, 13, 10, 109, 101,
    109, 95, 110, 111, 116, 95, 99, 111, 117, 110, 116, 101, 100, 95, 102, 111, 114, 95, 101, 118,
    105, 99, 116, 58, 56, 13, 10, 109, 101, 109, 95, 114, 101, 112, 108, 105, 99, 97, 116, 105,
    111, 110, 95, 98, 97, 99, 107, 108, 111, 103, 58, 48, 13, 10, 109, 101, 109, 95, 116, 111, 116,
    97, 108, 95, 114, 101, 112, 108, 105, 99, 97, 116, 105, 111, 110, 95, 98, 117, 102, 102, 101,
    114, 115, 58, 48, 13, 10, 109, 101, 109, 95, 99, 108, 105, 101, 110, 116, 115, 95, 115, 108,
    97, 118, 101, 115, 58, 48, 13, 10, 109, 101, 109, 95, 99, 108, 105, 101, 110, 116, 115, 95,
    110, 111, 114, 109, 97, 108, 58, 48, 13, 10, 109, 101, 109, 95, 99, 108, 117, 115, 116, 101,
    114, 95, 108, 105, 110, 107, 115, 58, 48, 13, 10, 109, 101, 109, 95, 97, 111, 102, 95, 98, 117,
    102, 102, 101, 114, 58, 56, 13, 10, 109, 101, 109, 95, 97, 108, 108, 111, 99, 97, 116, 111,
    114, 58, 106, 101, 109, 97, 108, 108, 111, 99, 45, 53, 46, 51, 46, 48, 13, 10, 97, 99, 116,
    105, 118, 101, 95, 100, 101, 102, 114, 97, 103, 95, 114, 117, 110, 110, 105, 110, 103, 58, 48,
    13, 10, 108, 97, 122, 121, 102, 114, 101, 101, 95, 112, 101, 110, 100, 105, 110, 103, 95, 111,
    98, 106, 101, 99, 116, 115, 58, 48, 13, 10, 108, 97, 122, 121, 102, 114, 101, 101, 100, 95,
    111, 98, 106, 101, 99, 116, 115, 58, 48, 13, 10, 13, 10, 35, 32, 80, 101, 114, 115, 105, 115,
    116, 101, 110, 99, 101, 13, 10, 108, 111, 97, 100, 105, 110, 103, 58, 48, 13, 10, 97, 115, 121,
    110, 99, 95, 108, 111, 97, 100, 105, 110, 103, 58, 48, 13, 10, 99, 117, 114, 114, 101, 110,
    116, 95, 99, 111, 119, 95, 112, 101, 97, 107, 58, 48, 13, 10, 99, 117, 114, 114, 101, 110, 116,
    95, 99, 111, 119, 95, 115, 105, 122, 101, 58, 48, 13, 10, 99, 117, 114, 114, 101, 110, 116, 95,
    99, 111, 119, 95, 115, 105, 122, 101, 95, 97, 103, 101, 58, 48, 13, 10, 99, 117, 114, 114, 101,
    110, 116, 95, 102, 111, 114, 107, 95, 112, 101, 114, 99, 58, 48, 46, 48, 48, 13, 10, 99, 117,
    114, 114, 101, 110, 116, 95, 115, 97, 118, 101, 95, 107, 101, 121, 115, 95, 112, 114, 111, 99,
    101, 115, 115, 101, 100, 58, 48, 13, 10, 99, 117, 114, 114, 101, 110, 116, 95, 115, 97, 118,
    101, 95, 107, 101, 121, 115, 95, 116, 111, 116, 97, 108, 58, 48, 13, 10, 114, 100, 98, 95, 99,
    104, 97, 110, 103, 101, 115, 95, 115, 105, 110, 99, 101, 95, 108, 97, 115, 116, 95, 115, 97,
    118, 101, 58, 48, 13, 10, 114, 100, 98, 95, 98, 103, 115, 97, 118, 101, 95, 105, 110, 95, 112,
    114, 111, 103, 114, 101, 115, 115, 58, 48, 13, 10, 114, 100, 98, 95, 108, 97, 115, 116, 95,
    115, 97, 118, 101, 95, 116, 105, 109, 101, 58, 49, 55, 50, 53, 50, 51, 57, 54, 57, 48, 13, 10,
    114, 100, 98, 95, 108, 97, 115, 116, 95, 98, 103, 115, 97, 118, 101, 95, 115, 116, 97, 116,
    117, 115, 58, 111, 107, 13, 10, 114, 100, 98, 95, 108, 97, 115, 116, 95, 98, 103, 115, 97, 118,
    101, 95, 116, 105, 109, 101, 95, 115, 101, 99, 58, 48, 13, 10, 114, 100, 98, 95, 99, 117, 114,
    114, 101, 110, 116, 95, 98, 103, 115, 97, 118, 101, 95, 116, 105, 109, 101, 95, 115, 101, 99,
    58, 45, 49, 13, 10, 114, 100, 98, 95, 115, 97, 118, 101, 115, 58, 49, 13, 10, 114, 100, 98, 95,
    108, 97, 115, 116, 95, 99, 111, 119, 95, 115, 105, 122, 101, 58, 57, 53, 56, 52, 54, 52, 13,
    10, 114, 100, 98, 95, 108, 97, 115, 116, 95, 108, 111, 97, 100, 95, 107, 101, 121, 115, 95,
    101, 120, 112, 105, 114, 101, 100, 58, 48, 13, 10, 114, 100, 98, 95, 108, 97, 115, 116, 95,
    108, 111, 97, 100, 95, 107, 101, 121, 115, 95, 108, 111, 97, 100, 101, 100, 58, 48, 13, 10, 97,
    111, 102, 95, 101, 110, 97, 98, 108, 101, 100, 58, 49, 13, 10, 97, 111, 102, 95, 114, 101, 119,
    114, 105, 116, 101, 95, 105, 110, 95, 112, 114, 111, 103, 114, 101, 115, 115, 58, 48, 13, 10,
    97, 111, 102, 95, 114, 101, 119, 114, 105, 116, 101, 95, 115, 99, 104, 101, 100, 117, 108, 101,
    100, 58, 48, 13, 10, 97, 111, 102, 95, 108, 97, 115, 116, 95, 114, 101, 119, 114, 105, 116,
    101, 95, 116, 105, 109, 101, 95, 115, 101, 99, 58, 45, 49, 13, 10, 97, 111, 102, 95, 99, 117,
    114, 114, 101, 110, 116, 95, 114, 101, 119, 114, 105, 116, 101, 95, 116, 105, 109, 101, 95,
    115, 101, 99, 58, 45, 49, 13, 10, 97, 111, 102, 95, 108, 97, 115, 116, 95, 98, 103, 114, 101,
    119, 114, 105, 116, 101, 95, 115, 116, 97, 116, 117, 115, 58, 111, 107, 13, 10, 97, 111, 102,
    95, 114, 101, 119, 114, 105, 116, 101, 115, 58, 48, 13, 10, 97, 111, 102, 95, 114, 101, 119,
    114, 105, 116, 101, 115, 95, 99, 111, 110, 115, 101, 99, 117, 116, 105, 118, 101, 95, 102, 97,
    105, 108, 117, 114, 101, 115, 58, 48, 13, 10, 97, 111, 102, 95, 108, 97, 115, 116, 95, 119,
    114, 105, 116, 101, 95, 115, 116, 97, 116, 117, 115, 58, 111, 107, 13, 10, 97, 111, 102, 95,
    108, 97, 115, 116, 95, 99, 111, 119, 95, 115, 105, 122, 101, 58, 48, 13, 10, 109, 111, 100,
    117, 108, 101, 95, 102, 111, 114, 107, 95, 105, 110, 95, 112, 114, 111, 103, 114, 101, 115,
    115, 58, 48, 13, 10, 109, 111, 100, 117, 108, 101, 95, 102, 111, 114, 107, 95, 108, 97, 115,
    116, 95, 99, 111, 119, 95, 115, 105, 122, 101, 58, 48, 13, 10, 97, 111, 102, 95, 99, 117, 114,
    114, 101, 110, 116, 95, 115, 105, 122, 101, 58, 49, 54, 49, 50, 52, 52, 53, 13, 10, 97, 111,
    102, 95, 98, 97, 115, 101, 95, 115, 105, 122, 101, 58, 56, 56, 13, 10, 97, 111, 102, 95, 112,
    101, 110, 100, 105, 110, 103, 95, 114, 101, 119, 114, 105, 116, 101, 58, 48, 13, 10, 97, 111,
    102, 95, 98, 117, 102, 102, 101, 114, 95, 108, 101, 110, 103, 116, 104, 58, 48, 13, 10, 97,
    111, 102, 95, 112, 101, 110, 100, 105, 110, 103, 95, 98, 105, 111, 95, 102, 115, 121, 110, 99,
    58, 48, 13, 10, 97, 111, 102, 95, 100, 101, 108, 97, 121, 101, 100, 95, 102, 115, 121, 110, 99,
    58, 48, 13, 10, 13, 10, 35, 32, 83, 116, 97, 116, 115, 13, 10, 116, 111, 116, 97, 108, 95, 99,
    111, 110, 110, 101, 99, 116, 105, 111, 110, 115, 95, 114, 101, 99, 101, 105, 118, 101, 100, 58,
    53, 13, 10, 116, 111, 116, 97, 108, 95, 99, 111, 109, 109, 97, 110, 100, 115, 95, 112, 114,
    111, 99, 101, 115, 115, 101, 100, 58, 57, 13, 10, 105, 110, 115, 116, 97, 110, 116, 97, 110,
    101, 111, 117, 115, 95, 111, 112, 115, 95, 112, 101, 114, 95, 115, 101, 99, 58, 48, 13, 10,
    116, 111, 116, 97, 108, 95, 110, 101, 116, 95, 105, 110, 112, 117, 116, 95, 98, 121, 116, 101,
    115, 58, 53, 50, 53, 13, 10, 116, 111, 116, 97, 108, 95, 110, 101, 116, 95, 111, 117, 116, 112,
    117, 116, 95, 98, 121, 116, 101, 115, 58, 50, 51, 54, 53, 53, 13, 10, 116, 111, 116, 97, 108,
    95, 110, 101, 116, 95, 114, 101, 112, 108, 95, 105, 110, 112, 117, 116, 95, 98, 121, 116, 101,
    115, 58, 48, 13, 10, 116, 111, 116, 97, 108, 95, 110, 101, 116, 95, 114, 101, 112, 108, 95,
    111, 117, 116, 112, 117, 116, 95, 98, 121, 116, 101, 115, 58, 48, 13, 10, 105, 110, 115, 116,
    97, 110, 116, 97, 110, 101, 111, 117, 115, 95, 105, 110, 112, 117, 116, 95, 107, 98, 112, 115,
    58, 48, 46, 48, 48, 13, 10, 105, 110, 115, 116, 97, 110, 116, 97, 110, 101, 111, 117, 115, 95,
    111, 117, 116, 112, 117, 116, 95, 107, 98, 112, 115, 58, 48, 46, 48, 48, 13, 10, 105, 110, 115,
    116, 97, 110, 116, 97, 110, 101, 111, 117, 115, 95, 105, 110, 112, 117, 116, 95, 114, 101, 112,
    108, 95, 107, 98, 112, 115, 58, 48, 46, 48, 48, 13, 10, 105, 110, 115, 116, 97, 110, 116, 97,
    110, 101, 111, 117, 115, 95, 111, 117, 116, 112, 117, 116, 95, 114, 101, 112, 108, 95, 107, 98,
    112, 115, 58, 48, 46, 48, 48, 13, 10, 114, 101, 106, 101, 99, 116, 101, 100, 95, 99, 111, 110,
    110, 101, 99, 116, 105, 111, 110, 115, 58, 48, 13, 10, 115, 121, 110, 99, 95, 102, 117, 108,
    108, 58, 48, 13, 10, 115, 121, 110, 99, 95, 112, 97, 114, 116, 105, 97, 108, 95, 111, 107, 58,
    48, 13, 10, 115, 121, 110, 99, 95, 112, 97, 114, 116, 105, 97, 108, 95, 101, 114, 114, 58, 48,
    13, 10, 101, 120, 112, 105, 114, 101, 100, 95, 107, 101, 121, 115, 58, 48, 13, 10, 101, 120,
    112, 105, 114, 101, 100, 95, 115, 116, 97, 108, 101, 95, 112, 101, 114, 99, 58, 48, 46, 48, 48,
    13, 10, 101, 120, 112, 105, 114, 101, 100, 95, 116, 105, 109, 101, 95, 99, 97, 112, 95, 114,
    101, 97, 99, 104, 101, 100, 95, 99, 111, 117, 110, 116, 58, 48, 13, 10, 101, 120, 112, 105,
    114, 101, 95, 99, 121, 99, 108, 101, 95, 99, 112, 117, 95, 109, 105, 108, 108, 105, 115, 101,
    99, 111, 110, 100, 115, 58, 53, 13, 10, 101, 118, 105, 99, 116, 101, 100, 95, 107, 101, 121,
    115, 58, 48, 13, 10, 101, 118, 105, 99, 116, 101, 100, 95, 99, 108, 105, 101, 110, 116, 115,
    58, 48, 13, 10, 116, 111, 116, 97, 108, 95, 101, 118, 105, 99, 116, 105, 111, 110, 95, 101,
    120, 99, 101, 101, 100, 101, 100, 95, 116, 105, 109, 101, 58, 48, 13, 10, 99, 117, 114, 114,
    101, 110, 116, 95, 101, 118, 105, 99, 116, 105, 111, 110, 95, 101, 120, 99, 101, 101, 100, 101,
    100, 95, 116, 105, 109, 101, 58, 48, 13, 10, 107, 101, 121, 115, 112, 97, 99, 101, 95, 104,
    105, 116, 115, 58, 48, 13, 10, 107, 101, 121, 115, 112, 97, 99, 101, 95, 109, 105, 115, 115,
    101, 115, 58, 48, 13, 10, 112, 117, 98, 115, 117, 98, 95, 99, 104, 97, 110, 110, 101, 108, 115,
    58, 48, 13, 10, 112, 117, 98, 115, 117, 98, 95, 112, 97, 116, 116, 101, 114, 110, 115, 58, 48,
    13, 10, 112, 117, 98, 115, 117, 98, 115, 104, 97, 114, 100, 95, 99, 104, 97, 110, 110, 101,
    108, 115, 58, 48, 13, 10, 108, 97, 116, 101, 115, 116, 95, 102, 111, 114, 107, 95, 117, 115,
    101, 99, 58, 49, 55, 55, 13, 10, 116, 111, 116, 97, 108, 95, 102, 111, 114, 107, 115, 58, 49,
    13, 10, 109, 105, 103, 114, 97, 116, 101, 95, 99, 97, 99, 104, 101, 100, 95, 115, 111, 99, 107,
    101, 116, 115, 58, 48, 13, 10, 115, 108, 97, 118, 101, 95, 101, 120, 112, 105, 114, 101, 115,
    95, 116, 114, 97, 99, 107, 101, 100, 95, 107, 101, 121, 115, 58, 48, 13, 10, 97, 99, 116, 105,
    118, 101, 95, 100, 101, 102, 114, 97, 103, 95, 104, 105, 116, 115, 58, 48, 13, 10, 97, 99, 116,
    105, 118, 101, 95, 100, 101, 102, 114, 97, 103, 95, 109, 105, 115, 115, 101, 115, 58, 48, 13,
    10, 97, 99, 116, 105, 118, 101, 95, 100, 101, 102, 114, 97, 103, 95, 107, 101, 121, 95, 104,
    105, 116, 115, 58, 48, 13, 10, 97, 99, 116, 105, 118, 101, 95, 100, 101, 102, 114, 97, 103, 95,
    107, 101, 121, 95, 109, 105, 115, 115, 101, 115, 58, 48, 13, 10, 116, 111, 116, 97, 108, 95,
    97, 99, 116, 105, 118, 101, 95, 100, 101, 102, 114, 97, 103, 95, 116, 105, 109, 101, 58, 48,
    13, 10, 99, 117, 114, 114, 101, 110, 116, 95, 97, 99, 116, 105, 118, 101, 95, 100, 101, 102,
    114, 97, 103, 95, 116, 105, 109, 101, 58, 48, 13, 10, 116, 114, 97, 99, 107, 105, 110, 103, 95,
    116, 111, 116, 97, 108, 95, 107, 101, 121, 115, 58, 48, 13, 10, 116, 114, 97, 99, 107, 105,
    110, 103, 95, 116, 111, 116, 97, 108, 95, 105, 116, 101, 109, 115, 58, 48, 13, 10, 116, 114,
    97, 99, 107, 105, 110, 103, 95, 116, 111, 116, 97, 108, 95, 112, 114, 101, 102, 105, 120, 101,
    115, 58, 48, 13, 10, 117, 110, 101, 120, 112, 101, 99, 116, 101, 100, 95, 101, 114, 114, 111,
    114, 95, 114, 101, 112, 108, 105, 101, 115, 58, 48, 13, 10, 116, 111, 116, 97, 108, 95, 101,
    114, 114, 111, 114, 95, 114, 101, 112, 108, 105, 101, 115, 58, 48, 13, 10, 100, 117, 109, 112,
    95, 112, 97, 121, 108, 111, 97, 100, 95, 115, 97, 110, 105, 116, 105, 122, 97, 116, 105, 111,
    110, 115, 58, 48, 13, 10, 116, 111, 116, 97, 108, 95, 114, 101, 97, 100, 115, 95, 112, 114,
    111, 99, 101, 115, 115, 101, 100, 58, 49, 52, 13, 10, 116, 111, 116, 97, 108, 95, 119, 114,
    105, 116, 101, 115, 95, 112, 114, 111, 99, 101, 115, 115, 101, 100, 58, 57, 13, 10, 105, 111,
    95, 116, 104, 114, 101, 97, 100, 101, 100, 95, 114, 101, 97, 100, 115, 95, 112, 114, 111, 99,
    101, 115, 115, 101, 100, 58, 48, 13, 10, 105, 111, 95, 116, 104, 114, 101, 97, 100, 101, 100,
    95, 119, 114, 105, 116, 101, 115, 95, 112, 114, 111, 99, 101, 115, 115, 101, 100, 58, 48, 13,
    10, 114, 101, 112, 108, 121, 95, 98, 117, 102, 102, 101, 114, 95, 115, 104, 114, 105, 110, 107,
    115, 58, 52, 13, 10, 114, 101, 112, 108, 121, 95, 98, 117, 102, 102, 101, 114, 95, 101, 120,
    112, 97, 110, 100, 115, 58, 48, 13, 10, 101, 118, 101, 110, 116, 108, 111, 111, 112, 95, 99,
    121, 99, 108, 101, 115, 58, 55, 50, 50, 50, 13, 10, 101, 118, 101, 110, 116, 108, 111, 111,
    112, 95, 100, 117, 114, 97, 116, 105, 111, 110, 95, 115, 117, 109, 58, 52, 54, 49, 52, 57, 51,
    13, 10, 101, 118, 101, 110, 116, 108, 111, 111, 112, 95, 100, 117, 114, 97, 116, 105, 111, 110,
    95, 99, 109, 100, 95, 115, 117, 109, 58, 51, 52, 55, 13, 10, 105, 110, 115, 116, 97, 110, 116,
    97, 110, 101, 111, 117, 115, 95, 101, 118, 101, 110, 116, 108, 111, 111, 112, 95, 99, 121, 99,
    108, 101, 115, 95, 112, 101, 114, 95, 115, 101, 99, 58, 57, 13, 10, 105, 110, 115, 116, 97,
    110, 116, 97, 110, 101, 111, 117, 115, 95, 101, 118, 101, 110, 116, 108, 111, 111, 112, 95,
    100, 117, 114, 97, 116, 105, 111, 110, 95, 117, 115, 101, 99, 58, 56, 48, 13, 10, 97, 99, 108,
    95, 97, 99, 99, 101, 115, 115, 95, 100, 101, 110, 105, 101, 100, 95, 97, 117, 116, 104, 58, 48,
    13, 10, 97, 99, 108, 95, 97, 99, 99, 101, 115, 115, 95, 100, 101, 110, 105, 101, 100, 95, 99,
    109, 100, 58, 48, 13, 10, 97, 99, 108, 95, 97, 99, 99, 101, 115, 115, 95, 100, 101, 110, 105,
    101, 100, 95, 107, 101, 121, 58, 48, 13, 10, 97, 99, 108, 95, 97, 99, 99, 101, 115, 115, 95,
    100, 101, 110, 105, 101, 100, 95, 99, 104, 97, 110, 110, 101, 108, 58, 48, 13, 10, 13, 10, 35,
    32, 82, 101, 112, 108, 105, 99, 97, 116, 105, 111, 110, 13, 10, 114, 111, 108, 101, 58, 109,
    97, 115, 116, 101, 114, 13, 10, 99, 111, 110, 110, 101, 99, 116, 101, 100, 95, 115, 108, 97,
    118, 101, 115, 58, 48, 13, 10, 109, 97, 115, 116, 101, 114, 95, 102, 97, 105, 108, 111, 118,
    101, 114, 95, 115, 116, 97, 116, 101, 58, 110, 111, 45, 102, 97, 105, 108, 111, 118, 101, 114,
    13, 10, 109, 97, 115, 116, 101, 114, 95, 114, 101, 112, 108, 105, 100, 58, 56, 98, 99, 98, 98,
    100, 100, 54, 49, 56, 102, 99, 53, 97, 49, 102, 57, 51, 97, 55, 97, 51, 55, 54, 52, 51, 49, 50,
    101, 54, 101, 55, 53, 98, 51, 57, 52, 99, 51, 48, 13, 10, 109, 97, 115, 116, 101, 114, 95, 114,
    101, 112, 108, 105, 100, 50, 58, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
    48, 13, 10, 109, 97, 115, 116, 101, 114, 95, 114, 101, 112, 108, 95, 111, 102, 102, 115, 101,
    116, 58, 48, 13, 10, 115, 101, 99, 111, 110, 100, 95, 114, 101, 112, 108, 95, 111, 102, 102,
    115, 101, 116, 58, 45, 49, 13, 10, 114, 101, 112, 108, 95, 98, 97, 99, 107, 108, 111, 103, 95,
    97, 99, 116, 105, 118, 101, 58, 48, 13, 10, 114, 101, 112, 108, 95, 98, 97, 99, 107, 108, 111,
    103, 95, 115, 105, 122, 101, 58, 49, 48, 52, 56, 53, 55, 54, 13, 10, 114, 101, 112, 108, 95,
    98, 97, 99, 107, 108, 111, 103, 95, 102, 105, 114, 115, 116, 95, 98, 121, 116, 101, 95, 111,
    102, 102, 115, 101, 116, 58, 48, 13, 10, 114, 101, 112, 108, 95, 98, 97, 99, 107, 108, 111,
    103, 95, 104, 105, 115, 116, 108, 101, 110, 58, 48, 13, 10, 13, 10, 35, 32, 67, 80, 85, 13, 10,
    117, 115, 101, 100, 95, 99, 112, 117, 95, 115, 121, 115, 58, 48, 46, 53, 52, 56, 55, 54, 50,
    13, 10, 117, 115, 101, 100, 95, 99, 112, 117, 95, 117, 115, 101, 114, 58, 48, 46, 48, 53, 57,
    53, 54, 51, 13, 10, 117, 115, 101, 100, 95, 99, 112, 117, 95, 115, 121, 115, 95, 99, 104, 105,
    108, 100, 114, 101, 110, 58, 48, 46, 48, 48, 50, 51, 57, 57, 13, 10, 117, 115, 101, 100, 95,
    99, 112, 117, 95, 117, 115, 101, 114, 95, 99, 104, 105, 108, 100, 114, 101, 110, 58, 48, 46,
    48, 48, 49, 54, 49, 57, 13, 10, 117, 115, 101, 100, 95, 99, 112, 117, 95, 115, 121, 115, 95,
    109, 97, 105, 110, 95, 116, 104, 114, 101, 97, 100, 58, 48, 46, 53, 52, 57, 50, 51, 50, 13, 10,
    117, 115, 101, 100, 95, 99, 112, 117, 95, 117, 115, 101, 114, 95, 109, 97, 105, 110, 95, 116,
    104, 114, 101, 97, 100, 58, 48, 46, 48, 53, 56, 52, 53, 55, 13, 10, 13, 10, 35, 32, 77, 111,
    100, 117, 108, 101, 115, 13, 10, 109, 111, 100, 117, 108, 101, 58, 110, 97, 109, 101, 61, 82,
    101, 74, 83, 79, 78, 44, 118, 101, 114, 61, 50, 48, 54, 48, 57, 44, 97, 112, 105, 61, 49, 44,
    102, 105, 108, 116, 101, 114, 115, 61, 48, 44, 117, 115, 101, 100, 98, 121, 61, 91, 93, 44,
    117, 115, 105, 110, 103, 61, 91, 93, 44, 111, 112, 116, 105, 111, 110, 115, 61, 91, 104, 97,
    110, 100, 108, 101, 45, 105, 111, 45, 101, 114, 114, 111, 114, 115, 93, 13, 10, 13, 10, 35, 32,
    69, 114, 114, 111, 114, 115, 116, 97, 116, 115, 13, 10, 13, 10, 35, 32, 67, 108, 117, 115, 116,
    101, 114, 13, 10, 99, 108, 117, 115, 116, 101, 114, 95, 101, 110, 97, 98, 108, 101, 100, 58,
    48, 13, 10, 13, 10, 35, 32, 75, 101, 121, 115, 112, 97, 99, 101, 13, 10, 100, 98, 48, 58, 107,
    101, 121, 115, 61, 49, 55, 44, 101, 120, 112, 105, 114, 101, 115, 61, 48, 44, 97, 118, 103, 95,
    116, 116, 108, 61, 48, 13, 10, 13, 10,
];
#[test]
fn test1() {
    // use serde::de::Deserializer;
    // let des = redius::resp::Resp3Deserializer::new(&bytes);
    // des.deserialize_any(visitor);
    let mut des = redius::resp::Resp3Deserializer::new(&BYTES);
    match HelloResponse::deserialize(&mut des) {
        Ok(a) => {
            println!("{:#?}", a);
        }
        Err(err) => eprintln!("{}", err),
    }
}

#[test]
fn test2() {
    let val = "1.242983E12";
    match val.parse::<f64>() {
        Ok(num) => {
            println!("num={num}")
        }
        Err(err) => {
            eprintln!("err = {err}");
        }
    }
}

#[test]
fn test3() {
    let mut stream_buffer = FrameBuffer::new();
    stream_buffer.put(&BYTES_2);
    match stream_buffer.read_next_values() {
        Ok(vals) => {
            for item in vals {
                // match &item {
                //     redius::resp::Value::Map(map) => {
                //         // println!("this is map");
                //         // for (key, _val) in map {
                //         //     println!("key = {key}")
                //         // }
                //     }
                //     _ => {
                //         println!("this is not map");
                //     }
                // }
                println!("{:#?}", item.into_string());
                // let a = HelloResponse::deserialize(&item).unwrap();
                // println!("hello = {a:#?}");
            }
        }
        Err(err) => {
            eprintln!("err = {err}");
        }
    }
}

// #[derive(serde::Deserialize, Debug)]
// pub struct A {
//     f1: String,

//     f2: i16,
// }

// impl Default for A {
//     fn default() -> Self {
//         Self {
//             ..Default::default()
//         }
//     }
// }

#[derive(serde::Deserialize, Debug)]
pub struct HelloResponse {
    pub server: String,
    pub version: String,
    pub proto: u8,
    pub id: u32,
    pub mode: String,
    pub role: String,
    pub modules: Vec<RedisModule>,
    // pub os: String,
}

#[derive(serde::Deserialize, Debug)]
pub struct RedisModule {
    pub name: String,
    pub ver: i32,
    pub path: String,
    pub args: Vec<String>,
}

#[test]
fn test4() {
    let mut kv = HashMap::<String, String>::new();
    kv.insert("1".to_string(), "a".to_string());
    kv.insert("2".to_string(), "b".to_string());
    kv.insert("3".to_string(), "c".to_string());
    kv.insert("4".to_string(), "d".to_string());
    println!("len = {}", kv.len());
    // let mut iter = kv.iter();
    // if let Some((key, val)) = iter.nth(0) {
    //     println!("key = {key}, val = {val}");
    // }
    // if let Some((key, val)) = iter.nth(1) {
    //     println!("key = {key}, val = {val}");
    // }
    // if let Some((key, val)) = iter.nth(2) {
    //     println!("key = {key}, val = {val}");
    // }
    let mut keys = kv.keys();
    if let Some(key) = keys.nth(0) {
        println!("key = {key}");
    }
    if let Some(key) = keys.nth(0) {
        println!("key = {key}");
    }
    if let Some(key) = keys.nth(0) {
        println!("key = {key}");
    }
    if let Some(key) = keys.nth(0) {
        println!("key = {key}");
    }
}

#[test]
fn test5() {
    let buf = b"OK".to_vec();
    let value = Value::SimpleString(buf);
    match Vec::<u8>::deserialize(&value) {
        Ok(str) => {
            println!("{str:?}")
        }
        Err(err) => {
            eprintln!("{err}")
        }
    }
}

#[test]
fn test6() {
    let mut frame_buffer = FrameBuffer::new();
    frame_buffer.put(&[58, 49, 50, 13, 10]);
    match frame_buffer.read_next_values() {
        Ok(vals) => {
            for item in vals {
                // match &item {
                //     redius::resp::Value::Map(map) => {
                //         // println!("this is map");
                //         // for (key, _val) in map {
                //         //     println!("key = {key}")
                //         // }
                //     }
                //     _ => {
                //         println!("this is not map");
                //     }
                // }
                println!("{:?}", item);
            }
        }
        Err(err) => {
            eprintln!("err = {err}");
        }
    }
}

#[test]
fn test7() {
    let mut vec = smallvec::SmallVec::<[usize; 4]>::new();
    vec.push(1);
    vec.push(51);
    vec.push(2);
    vec.push(3);
    vec.push(64);
    vec.push(55);
    vec.sort_by(|a, b| b.cmp(a));
    println!("{vec:?}")
}
